/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.order;

import cn.ekuma.data.dao.I_DataLogic;
import cn.ekuma.data.ui.swing.SwingEditorRecord;
import cn.ekuma.epos.datalogic.I_DataLogicERP;
import cn.ekuma.epos.datalogic.I_DataLogicSystem;
import cn.ekuma.epos.datalogic.businesslogic.orderprocess.I_ProcessManager;
import cn.ekuma.epos.module.ERP_UI_Swing_Model;
import cn.ekuma.epos.panel.JPanelTableDAO;

import com.openbravo.data.basic.BasicException;
import com.openbravo.pos.model.AbstractPosSwingModel;
import com.openbravo.bean.erp.OrderType;

import java.awt.Component;

/**
 *
 * @author Administrator
 */
@SuppressWarnings("serial")
public class JOrderTypePanel extends JPanelTableDAO<OrderType>{
    private I_DataLogicERP m_dlSales;
    private I_DataLogicSystem m_dlSystem;
    private JOrderTypeEditor jeditor;
    private I_ProcessManager processManager;

    @Override
    protected void init() {
        jeditor=new JOrderTypeEditor(m_dlSales,m_dlSystem,dirty,processManager);
    }

    @Override
    public SwingEditorRecord getEditor() {
        return jeditor;
    }

    @Override
    public String getTitle() {
        return "";
    }

    @Override
    public void activate() throws BasicException {
        jeditor.activate();
        super.activate();
    }

    @Override
    public Component getFilter() {
        return null;
    }

    @Override
    public I_DataLogic getDataLogic() {
        return m_dlSales;
    }

    @Override
    public Class getSuportClass() {
        return OrderType.class;
    }

    @Override
    public String getObjectRenderString(OrderType obj) {
        return obj.getName();
    }

	@Override
	public String getModelName() {
		return ERP_UI_Swing_Model.MODEL_NAME;
	}

	@Override
	public void setModel(AbstractPosSwingModel mode) {
		 m_dlSales = mode.getDLERP();
	     m_dlSystem =mode.getDLSystem();
	     processManager=mode.getProcessManager();
		
	}

}
